<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
   xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
   xmlns:f="http://xmlns.jcp.org/jsf/core"
   xmlns:h="http://xmlns.jcp.org/jsf/html"
   xmlns:p="http://primefaces.org/ui"
   xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
   template="/WEB-INF/templates/default.xhtml">
   
   	<f:metadata>
	   	<f:viewParam name="serviceBuyerId" value="#{serviceBuyerHome.id}"></f:viewParam>
	   	<f:event listener="#{serviceBuyerHome.initConversation()}" type="preRenderView"></f:event>
	   	<f:viewParam name="moduleName" value="审核采购方用户"></f:viewParam>
   	</f:metadata>
   
   	<ui:define name="content">
   
		<h:form id="editForm">         
			<p:panel id="panel" header="采购方基本信息审核" style="margin-bottom:10px;">
		       <p:messages id="messages" closable="true"><p:autoUpdate/></p:messages>        
		        <h:panelGrid columns="2" cellpadding="5">		
		        	<p:outputLabel value="统一社会信用代码" />
					<h:outputText 
							  value="#{serviceBuyerHome.instance.creditCode}" />
							  	     	     
					<p:outputLabel value="法定代表人" />				
					<h:outputText id="legalPerson" 
							  value="#{serviceBuyerHome.instance.legalPerson}" />
							  	          
					<p:outputLabel value="法人电话号码" />				
					<h:outputText id="legalPersonPhoneNumber" 
							  value="#{serviceBuyerHome.instance.legalPersonPhoneNumber}" />
							  	     
					<p:outputLabel for="cnname" value="用户名称" />				
					<h:outputText id="cnname" 
							  value="#{serviceBuyerHome.instance.cnname}"
						   required="true" />
					<p:outputLabel for="firstContactor" value="第一联系人" />				
					<h:outputText id="firstContactor" value="#{serviceBuyerHome.instance.firstContactor}" required="true"/>	 
					<p:outputLabel for="firstContactorPhoneNumber" value="第一联系人电话" />				
					<h:outputText id="firstContactorPhoneNumber" value="#{serviceBuyerHome.instance.firstContactorPhoneNumber}" required="true" />
					<p:outputLabel for="secondContactor" value="第二联系人" />				
					<h:outputText id="secondContactor" value="#{serviceBuyerHome.instance.secondContactor}" />	 
					<p:outputLabel for="secondContactorPhoneNumber" value="第二联系人电话" />				
					<h:outputText id="secondContactorPhoneNumber" value="#{serviceBuyerHome.instance.secondContactorPhoneNumber}"   />
					<p:outputLabel for="email" value="邮箱" />				
					<h:outputText id="email" value="#{serviceBuyerHome.instance.email}"  required="true"/>
		
					<p:outputLabel for="buyerType" value="用户类型" />
					<h:outputText id="buyerType" value="#{serviceBuyerHome.instance.buyerType}" /> 	 
					<p:outputLabel for="address" value="地址" />				
					<h:outputText id="address"  value="#{serviceBuyerHome.instance.address}" styleClass="input-large" />	 	 
				</h:panelGrid>
			</p:panel>
			<p:commandButton action="#{serviceBuyerHome.audit}" value="审核通过" ajax="false" />
			<p:commandButton oncomplete="PF('rejectDialog').show();" value="驳回" immediate="true"></p:commandButton>	
			<p:commandButton action="#{serviceBuyerHome.cancel()}" value="取消" immediate="true"></p:commandButton>
		</h:form>
      	
      	<p:dialog id="rejectDialog" widgetVar="rejectDialog">
			<f:facet name="header">
				驳回原因
			</f:facet>
			<h:form>
				<p:panelGrid columns="2">
					<p:outputLabel for="reason" value="驳回原因"></p:outputLabel>
					<p:inputTextarea
						id="reason"
						value="#{rejectRecordHome.instance.reason}"
						required="true"
						cols="80"
						rows="5"
					></p:inputTextarea>
				</p:panelGrid>
								
				<p:commandButton action="#{serviceBuyerHome.reject}" value="驳回" ajax="false" />
				<p:commandButton oncomplete="PF('rejectDialog').hide();" value="取消" immediate="true"></p:commandButton>
			</h:form>
		</p:dialog>
      	
   	</ui:define>
</ui:composition>
